﻿namespace WPFDBBrowser.UserControls
{
    using WPFDBBrowser.Framework;
    using WPFDBBrowser.Constants;
    using WPFDBBrowser.MessageBus.Messages;
    using System;

    public class QueryEditorPresenter : PresenterBase<IQueryEditor>
    {
        public QueryEditorPresenter()
        {
            base.MessageBus.Subscribe<QueryMsg>(this.GetIdentification(), Guid.NewGuid(), ReceivedQuery);
        }

        private void ReceivedQuery(QueryMsg message)
        {
            this.View.AddQuery(message.Query, true);
        }
        //protected override string GetIdentification()
        //{
        //    return ComponentNames.QUERYEDITOR_NAME;
        //}
    }
}
